home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: June 2000
- // Author: alipka
- //
- // Description:
- // Option tool property window for 3d Paint tool.
- //
- //
- // Procedure Name:
- // art3dPaintProperties
- //
- // Description:
- // Set up the the option values.
- //
- // Input Arguments:
- //
- // Return Value:
- // None.
- //
-
- proc art3dCreateBrushFrame(
- string $parent
- )
- //
- // Description:
- // Deal with stamp properties: radius, opacity, profiles.
- //
- {
- setUITemplate -pushTemplate OptionsTemplate;
- setParent $parent;
-
- columnLayout;
- floatSliderGrp -field true -label "Radius (U)"
- -ann "Brush radius."
- -precision 4
- -min 0.0 -max 50.0
- -step 0.05
- art3dUppRadiusSlider;
-
- floatSliderGrp -field true -label "Radius (L)"
- -ann "Lower brush radius limit."
- -precision 4
- -min 0.0 -max 50.0
- -step 0.05
- art3dLowRadiusSlider;
-
- separator -h 10 -style "none";
-
- rowColumnLayout -nc 7
- -cw 1 100 -cw 2 35 -cw 3 35
- -cw 4 35 -cw 5 35 -cw 6 35
- -cs 6 10 -cw 7 60;
-
- text -al "right"
- -l "Artisan: "
- -ann "Artisan stamp profiles."
- art3dProfileText;
-
- symbolCheckBox -w 33 -h 36 -i "circleGaus.xpm"
- -ann "Gaussian brush profile." art3dGaussianChBx;
- symbolCheckBox -w 33 -h 36 -i "circlePoly.xpm"
- -ann "Soft brush profile." art3dPolyBrushChBx;
- symbolCheckBox -w 33 -h 36 -i "circleSolid.xpm"
- -ann "Solid brush profile." art3dSolidChBx;
- symbolCheckBox -w 33 -h 36 -i "rect.xpm"
- -ann "Square brush profile." art3dRectBrushChBx;
- symbolCheckBox -w 33 -h 36 -i "file.xpm"
- -ann "Last image file - shape brush profile. " art3dFileBrushChBx;
- button -l "Browse"
- -ann "File browser for shape profiles." art3dShapeButton;
- setParent ..;
-
- separator -h 5 -style "none";
-
- rowColumnLayout -nc 4
- -cw 1 100 -cw 2 35
- -cs 3 35 -cw 3 35 -cw 4 35;
-
- text -al "right"
- -l "Paint Effects:"
- -ann "Paint Effects brushes."
- art3dProfileText;
-
- symbolCheckBox -w 33 -h 36 -i "lastPFXBrush.xpm"
- -ann "Last brush."
- art3dLastPFXBrush;
- symbolCheckBox -w 33 -h 36 -i "templateBrushSettings.xpm"
- -ann "Edit template brush."
- art3dPFXBrushEditor;
- symbolCheckBox -w 33 -h 36 -i "paintEffectsBrushesLarge.xpm"
- -ann "Get brush."
- art3dVisorEditor;
- setParent ..;
-
- separator -h 10 -style "none";
-
- checkBoxGrp
- -l "" -l1 "Rotate To Stroke"
- -ann "Brush alignment: path alignment or up vector."
- art3dPaintBrushAlignmentChkBox;
-
- separator -h 5 -style "none";
- setParent ..;
-
- setUITemplate -popTemplate;
- }
-
- proc art3dCreateColorFrame(
- string $parent
- )
- //
- // Description:
- // Create a 3d paint color options UI.
- //
- {
- setUITemplate -pushTemplate OptionsTemplate;
- setParent $parent;
-
- columnLayout;
- // Paint Color.
- colorSliderGrp -label "Color Value"
- -ann "Paint color"
- art3dColorSlider;
-
- floatSliderGrp -field true -l "Opacity "
- -ann "Brush opacity."
- -precision 4
- -min 0.0 -max 1.0
- -step 0.05
- art3dOpacitySlider;
-
- separator -h 15 -style "none";
- setParent ..;
-
- setUITemplate -popTemplate;
- }
-
-
- proc art3dCreateFloodFrame(
- string $parent
- )
- //
- // Description:
- // Create a 3d paint Flood options UI.
- //
- {
- setUITemplate -pushTemplate OptionsTemplate;
- setParent $parent;
-
- columnLayout;
- // Flood Color.
- colorSliderGrp -label "Color "
- -ann "Flood color"
- art3dFloodColorSlider;
-
- floatSliderGrp -field true -l "Opacity "
- -ann "Flood opacity."
- -precision 4
- -min 0.0 -max 1.0
- -step 0.05
- art3dFloodOpacitySlider;
-
- separator -h 15 -style "none";
-
- // Flood Buttons.
- rowColumnLayout -nc 2
- -cs 1 45
- -cw 1 120 -cs 2 40
- -cw 2 120;
-
- button -l "Flood Paint "
- -width 120
- -ann "Flood paint"
- art3dFloodPaintButton; // Flood Paint
-
- button -l "Flood Erase "
- -width 120
- -ann "Flood erase"
- art3dFloodEraseButton; // Flood Erase
- setParent ..;
- separator -h 5 -style "none";
-
- // Flood Option.
- radioButtonGrp -nrb 2 -sl 1
- -l "Flood"
- -l1 "All" -l2 "Selected"
- -ann "Flooding option."
- art3dFloodOption;
- setParent ..;
-
- setUITemplate -popTemplate;
- }
-
-
- proc art3dCreateOperationFrame(
- string $parent
- )
- //
- // Description:
- // Create a 3d paint operation options UI.
- //
- {
- setUITemplate -pushTemplate OptionsTemplate;
- setParent $parent;
-
- columnLayout;
- // Paint Operation.
- radioButtonGrp -nrb 3
- -l "Artisan"
- -l1 "Paint" -l2 "Erase" -l3 "Clone"
- -ann "Attribute Paint operation."
- art3dPaintOperation0;
-
- radioButtonGrp -shareCollection art3dPaintOperation0
- -nrb 3
- -l "Paint Effects"
- -l1 "Paint" -l2 "Smear" -l3 "Blur"
- art3dPaintOperation1;
-
- rowColumnLayout -nc 1 -cs 1 135 -cw 1 134;
- button -l "Set Erase Image" -c ("art3dPaintCtx -e -updateEraseTex `currentCtx`")
- -ann "Set/Update Erase image for restoring" art3dEraseUpdateButton;
- setParent ..;
-
- separator -h 5 -style "none";
-
- rowColumnLayout -nc 1 -cs 1 135 -cw 1 134;
- button -l "Reset Brushes"
- -ann "Reset brushes and profiles to defaults"
- art3dResetBrushesButton;
- setParent ..;
-
- separator -h 5 -style "none";
-
- // Alpha blend mode.
- optionMenuGrp -l "Blend Mode "
- -ann "Blend Mode" art3dBlendModeOptionMenu;
- menuItem -l "Default" artBlendModeMenuItem0;
- menuItem -l "Lighten" artBlendModeMenuItem1;
- menuItem -l "Darken" artBlendModeMenuItem2;
- menuItem -l "Multiply" artBlendModeMenuItem3;
- menuItem -l "Screen" artBlendModeMenuItem4;
- menuItem -l "Overlay" artBlendModeMenuItem5;
-
- separator -h 10 -style "none";
-
- radioButtonGrp -nrb 2
- -l "Clone Brush Mode"
- -l1 "Dynamic" -l2 "Static"
- -ann "Clone brush mode."
- art3dCloneMode;
-
- rowColumnLayout -nc 1 -cs 1 135 -cw 1 134;
- button -l "Set Clone Source"
- -ann "Switch to clone source selection mode."
- art3dCloneSourceSelectionButton;
- setParent ..;
-
- separator -h 5 -style "none";
-
- intSliderGrp -field true -label "Blur Intensity"
- -ann "Control the intensity of the blur."
- -minValue 1 -maxValue 20
- -value 8
- art3dBlurIntSlider;
-
- separator -h 5 -style "none";
-
- setParent ..;
-
- setUITemplate -popTemplate;
- }
-
-
- proc art3dCreateFileTextureFrame(
- string $parent
- )
- //
- // Description:
- // Create a 3d paint file texture options UI.
- //
- {
- setUITemplate -pushTemplate OptionsTemplate;
- setParent $parent;
-
- columnLayout;
- // Texture Attribute to paint.
- optionMenuGrp -l "Attribute to Paint "
- -ann "Shader attribute to paint."
- art3dPaintAttrOptionMenu;
- menuItem -l "Color" art3dPaintAttrMenuItem0;
- menuItem -l "Transparency" art3dPaintAttrMenuItem1;
- menuItem -l "Incandescence" art3dPaintAttrMenuItem2;
- menuItem -l "BumpMap" art3dPaintAttrMenuItem3;
- menuItem -l "SpecularColor" art3dPaintAttrMenuItem4;
- menuItem -l "Reflectivity" art3dPaintAttrMenuItem5;
- menuItem -l "Ambient" art3dPaintAttrMenuItem6;
- menuItem -l "Diffuse" art3dPaintAttrMenuItem7;
- menuItem -l "Translucence" art3dPaintAttrMenuItem8;
- menuItem -l "ReflectedColor" art3dPaintAttrMenuItem9;
- menuItem -l "Displacement" art3dPaintAttrMenuItem10;
-
- separator -h 5 -style "none";
-
- // File Format.
- if(`about -mac`){
- optionMenuGrp -l "Image Format" art3dPaintFileFormatOptionMenu;
- menuItem -l "Tiff (tif)" art3dPaintFileFormatMenuItem0;
- menuItem -l "SGI (sgi)" art3dPaintFileFormatMenuItem1;
- menuItem -l "Maya IFF (iff)" art3dPaintFileFormatMenuItem2;
- menuItem -l "JPEG (jpeg)" art3dPaintFileFormatMenuItem3;
- menuItem -l "Targa (tga)" art3dPaintFileFormatMenuItem4;
- menuItem -l "WindowsBitmap (bmp)" art3dPaintFileFormatMenuItem5;
- menuItem -l "QuickTime Image (qtif)" art3dPaintFileFormatMenuItem6;
- menuItem -l "QuickDraw (pict)" art3dPaintFileFormatMenuItem7;
- menuItem -l "Photoshop (ps)" art3dPaintFileFormatMenuItem8;
- menuItem -l "PNG (png)" art3dPaintFileFormatMenuItem9;
- menuItem -l "MacPaint (pntg)" art3dPaintFileFormatMenuItem10;
- }else{
- optionMenuGrp -l "Image Format" art3dPaintFileFormatOptionMenu;
- menuItem -l "Alias PIX (als)" art3dPaintFileFormatMenuItem0;
- menuItem -l "EPS (eps)" art3dPaintFileFormatMenuItem3;
- menuItem -l "GIF (gif)" art3dPaintFileFormatMenuItem4;
- menuItem -l "JPEG (jpeg)" art3dPaintFileFormatMenuItem5;
- menuItem -l "Maya IFF (iff)" art3dPaintFileFormatMenuItem6;
- menuItem -l "RLA (rla)" art3dPaintFileFormatMenuItem9;
- menuItem -l "SGI (sgi)" art3dPaintFileFormatMenuItem10;
- menuItem -l "SoftImage (pic)" art3dPaintFileFormatMenuItem12;
- menuItem -l "Targa (tga)" art3dPaintFileFormatMenuItem13;
- menuItem -l "Tiff (tif)" art3dPaintFileFormatMenuItem14;
- }
-
-
- separator -h 5 -style "none";
-
- // Assign Textures button.
- rowColumnLayout -nc 1 -cs 1 135 -cw 1 134;
- button -l "Assign/Edit Textures"
- -ann "Assign/Edit file textures for a selected shader attribute to paint."
- -c ("art3dPaintAssignFileTexture( \"" + $parent + "\")")
- art3dAssignTexturesButton;
-
- separator -h 5 -style "none";
-
- button -l "Save Textures"
- -ann "Save textures to the disk."
- -c ("art3dPaintSaveFileTextures( \"" + $parent + "\")")
- art3dSaveTexturesButton;
-
- button -l "Reload File Textures"
- -ann "Reload textures from the disk."
- art3dReloadTexturesButton;
- setParent ..;
-
- separator -h 5 -style "none";
-
- // Update on each stroke.
- checkBoxGrp -ncb 1
- -l "" -l1 "Update on Stroke"
- -ann "Update textures on disk on each stroke."
- art3dSaveOnStrokeChkBox;
-
- // Save texture on each stroke.
- checkBoxGrp -ncb 1
- -l "" -l1 "Save Texture on Stroke"
- -ann "Save textures on disk on each stroke."
- art3dSaveTextureOnStrokeChkBox;
-
- // Fill in the background color.
- checkBoxGrp -ncb 1
- -l "" -l1 "Extend Seam Color"
- -ann "Average the color background pixels."
- art3dExtendFillColorChkBox;
-
- setParent ..;
-
- setUITemplate -popTemplate;
- }
-
-
- global proc art3dPressureMappings()
- {
- menuItem -l "off" aOff;
- menuItem -l "scale" aScale;
- menuItem -l "width" aWidth;
- menuItem -l "softness" aSoftness;
- menuItem -l "color" aColor;
- menuItem -l "transparency" aTransparency;
- menuItem -l "tube width" aTubeWidth;
- menuItem -l "tube length" aTubeLength;
- menuItem -l "incandescence" aIncandescence;
- menuItem -l "glow spread" aGlowSpread;
- menuItem -l "tubes per step" aTubesPerStep;
- menuItem -l "elevation" aElevation;
- menuItem -l "azimuth" aAzimuth;
- menuItem -l "path follow" aPathFollow;
- menuItem -l "path attract" aPathAttract;
- menuItem -l "random" aRandom;
- menuItem -l "wiggle" aWiggle;
- menuItem -l "curl" aCurl;
- menuItem -l "noise" aNoise;
- menuItem -l "turbulence" aTurbulence;
- menuItem -l "num twigs" aNumTwigs;
- menuItem -l "num leaves" aNumLeaves;
- menuItem -l "num petals" aNumPetals;
- menuItem -l "surface offset" aSurfaceOffset;
- }
-
-
- proc art3dCreateStrokeFrame(
- string $parent
- )
- //
- // Description:
- // Create a 3d Paint Stroke UI.
- //
- {
- setUITemplate -pushTemplate OptionsTemplate;
- setParent $parent;
-
- columnLayout;
- // Projective Paint Mode checkbox.
- checkBoxGrp
- -l "" -l1 "Screen Projection"
- -ann "Paint mode."
- art3dProjectionModeChkBox;
-
- // Reflection
- checkBoxGrp -ncb 3 -cw4 130 50 50 50
- -label "Reflection"
- -labelArray3 "X" "Y" "Z"
- -ann "Reflection Axis"
- art3dReflectionChBox;
-
- separator -h 10 -style "none";
- separator -h 10 -style "single";
- separator -h 10 -style "none";
-
- // Stamp Quality Sliders.
- floatSliderGrp -field true -label "Stamp Spacing"
- -ann "Spacing between stamps."
- -precision 4
- -min 0.01 -max 10.0
- -fieldMinValue 0.001 -fieldMaxValue 100.0
- -v 1.0
- -step 0.01
- art3dStampSpacingSlider;
-
- floatSliderGrp -field true -l "Stamp Depth"
- -ann "Depth of a single stamp."
- -precision 4
- -min 0.01 -max 10.0
- -fieldMinValue 0.001 -fieldMaxValue 100.0
- -v 1.0
- -step 0.01
- art3dStampDepthSlider;
- setParent ..;
-
- setUITemplate -popTemplate;
- }
-
-
- proc art3dCreatePressureFrame(
- string $parent
- )
- //
- // Description:
- // Create a 3d Paint Stylus Pressure UI.
- //
- {
- setUITemplate -pushTemplate OptionsTemplate;
- setParent $parent;
-
- columnLayout;
- // Tablet Pressure.
- checkBoxGrp
- -l "" -l1 "Stylus Pressure"
- -ann "Turn on/off stylus pressure."
- art3dStylusPressureChkBox;
-
- columnLayout art3dArtisanPressure;
- optionMenuGrp -l "Artisan Pressure"
- -cal 1 "right"
- -ann "Mapping of the tablet pressure."
- art3dArtisanPressure;
- menuItem -l "Opacity" art3dMapOpacity;
- menuItem -l "Radius" art3dMapRadius;
- menuItem -l "Both" art3dMapBoth;
- setParent ..;
-
- separator -h 10 -style "none";
-
- // Paint Effects Pressure.
- columnLayout art3dPaintEffectPressure;
- text -al "right"
- -l "Paint Effects Pressure: "
- art3dPaintEffectsPressureText;
-
- optionMenuGrp -l "Pressure Map 1" -cal 1 "right"
- art3dPressureMap1;
- art3dPressureMappings();
-
- floatSliderGrp -field true -label "Pressure Min 1"
- -precision 4
- -min 0.0 -max 1.0
- -fmn -10000.0 -fmx 10000.0
- -v 0.0
- art3dPressureMin1;
-
- floatSliderGrp -field true -label "Pressure Max 1"
- -precision 4
- -min 0.0 -max 1.0
- -fmn -10000.0 -fmx 10000.0
- -v 1.0
- art3dPressureMax1;
-
- optionMenuGrp -l "Pressure Map 2" -cal 1 "right"
- art3dPressureMap2;
- art3dPressureMappings();
-
- floatSliderGrp -field true -label "Pressure Min 2"
- -precision 4
- -min 0.0 -max 1.0
- -fmn -10000.0 -fmx 10000.0
- -v 0.0
- art3dPressureMin2;
-
- floatSliderGrp -field true -label "Pressure Max 2"
- -precision 4
- -min 0.0 -max 1.0
- -fmn -10000.0 -fmx 10000.0
- -v 1.0
- art3dPressureMax2;
-
- optionMenuGrp -l "Pressure Map 3" -cal 1 "right"
- art3dPressureMap3;
- art3dPressureMappings();
-
- floatSliderGrp -field true -label "Pressure Min 3"
- -precision 4
- -min 0.0 -max 1.0
- -fmn -10000.0 -fmx 10000.0
- -v 0.0
- art3dPressureMin3;
-
- floatSliderGrp -field true -label "Pressure Max 3"
- -precision 4
- -min 0.0 -max 1.0
- -fmn -10000.0 -fmx 10000.0
- -v 1.0
- art3dPressureMax3;
- setParent ..;
- separator -h 5 -style "none";
- setParent ..;
-
- setUITemplate -popTemplate;
- }
-
-
- proc art3dCreateDisplayFrame(
- string $parent
- )
- //
- // Description:
- // Create a 3d paint display opitons.
- //
- {
- setUITemplate -pushTemplate OptionsTemplate;
- setParent $parent;
-
- columnLayout;
- checkBoxGrp
- -l ""
- -l1 "Draw Outline"
- -ann "Draw brush outline."
- art3dDrawOutlineChkBox;
-
- checkBoxGrp -ncb 1
- -l ""
- -l1 "Draw Outline while Painting"
- -ann "Turn on/off brush feedback while painting."
- art3dBrushWhilePaintingChkBox;
-
- checkBoxGrp -ncb 1
- -l ""
- -l1 "Draw Brush Feedback"
- -ann "Draw additional brush feedback."
- art3dBrushFeedbackChkBox;
-
- checkBoxGrp
- -l ""
- -l1 "Show Wireframe"
- -ann "Draw wireframe in shaded mode."
- art3dShowActiveLinesChkBox;
- setParent ..;
-
- setUITemplate -popTemplate;
- }
-
-
-
- // =======================================================
- // Main Procedure.
- // =======================================================
- global proc art3dPaintProperties()
- {
- source "art3dPaintCallback.mel";
- source "art3dPaintValues.mel";
-
- setUITemplate -pushTemplate DefaultTemplate;
-
- string $parent = `toolPropertyWindow -q -location`;
- setParent $parent;
-
- columnLayout -adj true art3dPaint;
-
- // Brush options.
- frameLayout -label " Brush "
- -collapsable true -collapse false
- art3dBrushFrame;
-
- // Create brush option menu.
- art3dCreateBrushFrame("art3dBrushFrame");
- setParent ..;
-
- // Color options.
- frameLayout -l " Color "
- -collapsable true -collapse false
- art3dColorFrame;
-
- // Create the color options.
- art3dCreateColorFrame( "art3dColorFrame" );
- setParent ..;
-
- // Flood options.
- frameLayout -l " Flood "
- -collapsable true -collapse false
- art3dFloodFrame;
-
- // Create the Flood options.
- art3dCreateFloodFrame( "art3dFloodFrame" );
- setParent ..;
-
- // 3d Paint operations options.
- frameLayout -l " Paint Operations "
- -collapsable true -collapse false
- art3dOperationFrame;
-
- // Create paint operation options.
- art3dCreateOperationFrame( "art3dOperationFrame" );
- setParent ..;
-
- // File Texture options.
- frameLayout -l " File Textures "
- -collapsable true -collapse false
- art3dFileTextureFrame;
-
- // Create file texture options.
- art3dCreateFileTextureFrame( "art3dFileTextureFrame" );
- setParent ..;
-
- // Stroke options.
- frameLayout -l " Stroke "
- -collapsable true -collapse true
- art3dStrokeFrame;
-
- // Create stroke options.
- art3dCreateStrokeFrame( "art3dStrokeFrame" );
- setParent ..;
-
- // Stylus Pressure options.
- frameLayout -l " Stylus Pressure "
- -collapsable true -collapse true
- art3dPressureFrame;
-
- // Create stroke options.
- art3dCreatePressureFrame( "art3dPressureFrame" );
- setParent ..;
-
- // Display options.
- frameLayout -l " Display "
- -collapsable true -collapse true
- art3dDisplayFrame;
-
- // Create stroke options.
- art3dCreateDisplayFrame( "art3dDisplayFrame" );
- setParent ..;
-
- setParent ..; // columnLayout art3dPaint;
-
- setUITemplate -popTemplate;
-
- // Define the callbacks.
- art3dPaintCallback( "art3dPaintCtx" );
- }
-